<article class="dream-header">
  <section class="ui top attached center aligned segment">
    <div class="ui small circular image">
      {{ if isset .Site.Params "avatar" }}
        <img src="{{ .Site.Params.avatar | relURL }}">
      {{ end }}
    </div>

    <h1 class="ui medium header">
      {{- .Site.Params.author -}}{{- i18n "blogAlias" -}}
      <div class="sub header" style="margin-top: 0.5rem;">{{- .Site.Params.motto -}}</div>
    </h1>

    <div class="ui horizontal list">
      {{ if gt (len (where .Site.RegularPages "Section" "==" "posts")) 0 }}
      <a class="item" href="{{ "/posts" | relURL }}">
        <i class="archive icon" title="{{ i18n "archives" }}"></i>
      </a>
      {{ end }}
      <a class="item" href="{{ "/tags" | relURL }}">
        <i class="tags icon" title="{{ i18n "allTags" }}"></i>
      </a>
      <a class="item" href="{{ "/categories" | relURL }}">
        <i class="th list icon" title="{{ i18n "allCategories" }}"></i>
      </a>
    </div>
  </section>

  {{ if .Site.Taxonomies.tags }}
  <section class="ui attached center aligned segment dream-tags">
    {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
      <a class="ui label" href="{{ "tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">{{ $name }}</a>
    {{ end }}
  </section>
  {{ end }}

  {{ if .Site.Taxonomies.categories }}
  <section class="ui attached segment dream-categories">
    <div class="ui accordion">
      {{ range $name, $taxonomy := .Site.Taxonomies.categories }}
        <div class="title">
          <i class="dropdown icon"></i>
          <a href="{{ "categories/" | relLangURL }}{{ $name | urlize }}" class="item">{{ $name }}</a>
        </div>
        <div class="content">
          <div class="ui list">
          {{ range $taxonomy.Pages }}
            <div class="item">
              <div class="content">
                <a href="{{ .RelPermalink }}" class="item">{{ .LinkTitle }}</a>
              </div>
            </div>
          {{ end }}
          </div>
        </div>
      {{ end }}
    </div>
  </section>
  {{ end }}

  <section class="ui attached segment header-socials">
    {{ partial "socials.html" (dict "Site" .Site "IconSize" "") }}
  </section>

  <section class="ui bottom attached center aligned segment">
    {{ if .Site.Params.siteStartYear }}
      <p>© {{ if eq now.Year .Site.Params.siteStartYear }}{{ now.Year }}{{ else }}{{ .Site.Params.siteStartYear }} - {{ now.Year }}{{ end }} {{ .Site.Title }}</p>
    {{ else }}
      <p>© {{ now.Year }} {{ .Site.Title }}</p>
    {{ end }}

    <p>Powered by <a href="https://gohugo.io/" target="_blank">Hugo</a> with theme <a href="https://github.com/g1eny0ung/hugo-theme-dream" target="_blank">Dream</a>.</p>
  </section>
</article>
